<?php
/**
 * 会员申请分销商控制器
 * @author maniac
 */
namespace app\manage\controller;

use app\common\model\MemberRoles;
use app\facade\Members AS MembersFacade;
use app\common\model\Members AS MembersModel;

class MembersDistribution extends Base
{
    
    /**
     * where 查询条件
     * @return [type] [description]
     */
    public function where()
    {
        $keywords   = input('get.keywords', '');
        $startTime       = input('get.start_time/s', '');
        $endTime         = input('get.end_time/s', '');
        $where = '';

        if ($keywords) {

            $where[] = [
                ['nickname','like','%'.$keywords.'%']
            ];
        }
        if ($startTime) {
            $where[] = [
                ['create_time', 'egt', strtotime($startTime)],
            ];
        }
        if ($endTime) {
            $where[] = [
                ['create_time', 'lt', strtotime($endTime)],
            ];
        }
        $this->assign('startTime', $startTime);
        $this->assign('endTime', $endTime);
        $this->assign('keywords',$keywords);
        return $where;
    }
}
